<template>
	<view class="withdrawRecord">
		<view class="filter">
			
		</view>
		<view class="list">
			<view class="item flex-align-center" v-for="(item,index) in withdrawList" :key="index" @click="goDetail(item.hhrPointDetailId)" >
				<image src="https://cdcrm.oss-cn-hangzhou.aliyuncs.com/cdcrm/business/2024/4/12991714187496188.png" class="icon" mode=""></image>
				<view class="flex-1">
					<view class="bankNum"  v-if="item.cardNumber" >银行卡 ({{item.cardNumber.slice(-4)}})</view>
					<view class="date">{{item.createTime}}</view>
				</view>
				<view>
					<view class="money">-{{item.changePoint}}</view>
					<view class="status">{{item.txStatus | statusFilter}}</view>
				</view>
			</view>
		</view>
		<view class="flex-aj-center" style="margin-top: 200rpx;" v-if="withdrawList.length==0" >
			<image src="../../static/images/no-data.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	import { getWithdrawList } from "@/api/user.js"
	export default{
		data(){
			return{
				pageNum:1,
				withdrawList:[]
			}
		},
		onLoad() {
			this.getList()
		},
		filters:{
			statusFilter(val){
				if(val==0){
					return '未提现'
				}else if(val==1){
					return '待打款'
				}else if(val==2){
					return '已打款'
				}
			}
		},
		methods:{
			getList(){
				getWithdrawList({
					pageNum:this.pageNum,
					pageSize:10,
					sceneType:2
				}).then(res=>{
					if(this.pageNum==1){
						this.withdrawList = res.data.records
					}else{
						this.withdrawList = this.withdrawList.concat(res.data.records)
					}
					if(res.data.records.length<10){
						
					}else{
						this.pageNum++
					}
				})
			},
			goDetail(id){
				uni.navigateTo({
					url:'./recordDetail?id='+id
				})
			}
		},
		onReachBottom() {
			this.getList()
		}
	}
</script>
<style>
	page{
		background-color: #F5F7FA;
	}
</style>
<style lang="scss" scoped >
	.withdrawRecord{
		.list{
			padding: 24rpx;
			.item{
				background: #FFFFFF;
				border-radius: 16rpx;
				padding: 32rpx 24rpx;
				margin-bottom: 24rpx;
				.icon{
					width: 72rpx;
					height: 72rpx;
					margin-right: 24rpx;
				}
				.bankNum{
					font-family: PingFangSC;
					font-weight: 500;
					font-size: 32rpx;
					color: #292929;
					line-height: 32rpx;
					text-align: justify;
					font-style: normal;
					margin-bottom: 16rpx;
				}
				.date{
					font-family: PingFangSC;
					font-weight: 400;
					font-size: 24rpx;
					color: #999999;
					line-height: 24rpx;
					text-align: justify;
					font-style: normal;
				}
				.money{
					font-family: D-DINExp;
					font-weight: bold;
					font-size: 32rpx;
					color: #292929;
					line-height: 32rpx;
					text-align:right;
					font-style: normal;
					margin-bottom: 16rpx;
				}
				.status{
					font-family: PingFangSC;
					font-weight: 400;
					font-size: 24rpx;
					color: #FF781F;
					line-height: 24rpx;
					text-align: right;
					font-style: normal;
				}
			}
		}
	}
</style>